package alogrithm;

import java.util.HashSet;
import java.util.Set;
import java.util.Stack;

/**
 * @author lbw
 * @version 1.0
 * @date 2021/10/20 16:25
 */
public class RemoveParentheses {
    public static void main(String[] args) {
        System.out.println(new RemoveParentheses().removeParentheses("a(b(c(de)fgh)"));
    }

    public String removeParentheses(String s) {
        // write your code here.


        return "";
    }

    public boolean test(int[] arr) {
        if (arr == null) {
            return false;
        }
        int n = arr.length;
        if (n == 0) {
            return false;
        }
        if (n == 1) {
            return arr[0] == 0;
        }
        if (n == 2) {
            return (arr[0] == 0 && arr[1] == 1) || arr[1] == 0;
        }
        if (n == 3) {
            return (arr[0] == 0 && arr[1] == 1) || (arr[1] == 0 && arr[2] == 0);
        }

        boolean flag1 = true, flag2 = true;
        for (int i = 2; i < n; ++i) {
            if (arr[i] != arr[i - 1] + arr[i - 2]) {
                flag1 = false;
            }
        }
        for (int i = 3; i < n - 1; ++i) {
            if (arr[i] != arr[i - 1] + arr[i - 2]) {
                flag2 = false;
            }
        }
        return flag1 || flag2;
    }

    public void print(int[] arr1, int[] arr2) {
        Set<Integer> set = new HashSet<>();
        for (int i : arr1) {
            set.add(i);
        }
        for (int i : arr2) {
            if (!set.contains(i)) {
                set.remove(i);
            }
        }
        boolean flag = true;
        for (int i : set) {
            for (int j = 2; j <= i / 2; ++j) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                System.out.println(i);
            }
        }
    }
}
